<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller
{

    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $data['title_for_layout'] = 'AMCGIL';
        $data['content_layout']   = 'modulos/home/home';
        $this->load->view('template/layout_main',$data);
    }

    public function login()
    {

        $config = array(
            array(
                'field' => 'login',
                'label' => 'Login',
                'rules' => 'required|min_length[4]|max_length[10]|htmlspecialchars|xss_clean'
            ),
            array(
                'field' => 'senha',
                'label' => 'senha',
                'rules' => 'required|min_length[4]|max_length[10]|htmlspecialchars|md5'
            )
        );
        $this->form_validation->set_rules($config);
        if ($this->form_validation->run() == FALSE) {
            $this->index();
        } else {
            $data['login'] = $this->input->post('login');
            $data['senha'] = $this->input->post('senha');

            $this->load->model('admin/usuario_model');
            $login = $this->usuario_model->login($data);
            if (count($login) > 0) {
                
            }
        }
    }
}

/* End of file home.php */
/* Location: ./application/controller/home.php */